
<ion-view view-title='退货' >
  <ion-content>
    <ion-refresher on-refresh="doRefresh()"
                   pulling-text="下拉刷新..."
                   refreshing-text="拼命加载中..."
                   refreshing-icon="ion-loading-b">

    </ion-refresher>
      <div class="list card" ng-repeat="task in tasks" href="#">
        <div class="item">
          <h2>{{task.get('area_name')}}-

            <span ng-if="(task.get('type') != 9)" style="color: red;">{{task.get('type') | orderTypeName}}</span>
            <span ng-if="(task.get('type') === 9)">商家外卖</span>
            <span ng-bind-html="task.get('code') | colorString">
            </span>
            <a class="float-right" style=" color: orange" ng-click="bookTime(event,task.get('code'))">预约</a>
            <!--<span style="color: orange;">{{mymission.orderInfo.get('status') |  orderState }}</span>-->
          </h2>
        </div>
        <div class="item item-body">
          <p>
            <i class="icon ion-ios-home" style="font-size: x-large;color: orange;"></i>
            {{task.get('to_address')}}
          </p>
          <p>
            <i class="icon ion-ios-people" style="font-size: x-large;color: orange;"></i>
            {{task.get('to_name')}}
            <a href="tel:{{task.get('to_tel')}}">{{task.get('to_tel')}}</a>
            <a href="tel:{{task.get('to_tel')}}" class="icon ion-ios-telephone"></a>
          </p>
          <!--<p>
          下单时间：{{mymission.orderInfo.createdAt | date : 'yyyy-MM-dd HH:mm:ss'}}
          </p>-->
          <p >
            <i class="icon ion-arrow-graph-up-right" style="font-size: x-large;color: orange;"></i>
           {{task.get('status') |  orderState }}
          </p>
          <p ng-if="task.get('book_time') !=undefined">
            预约时间：{{task.get('book_time') | date : 'yyyy-MM-dd HH:mm:ss'}}
          </p>
        </div>
        <div class="row ">
          <!-- mymission.orderInfo.get('status') === 7000-->
          <div class="col" ng-show="task.get('status') === 8000 || task.get('status') === 7000">
            <button class="button button-assertive button-small button-block" ng-click="finishExpress(event,task.get('code'),task)">
              <i class="icon ion-android-walk "></i>
              <b>完成派送</b>
            </button>
          </div>
          <div class="col">
            <button class="button button-balanced button-small button-block" ng-click="reject(event,task.get('code'),task)">
              <i class="icon ion-sad-outline "></i>
              <b>拒收</b>
            </button>
          </div>
          <div class="col">
            <button class="button button-calm button-small button-block" ng-click="gotoDetail(event,task.get('code'))">
              <i class="icon ion-ios-book-outline "></i>
              <b>任务详情</b>
            </button>
          </div>
        </div>
      </div>
    <div  ng-if="showAppointment==1">
      <div class="list card">
        <label class="item item-input">
          <div class="input-label">修改预约日期</div>
          <input type="date" ng-model="task.yydate">
        </label>
      </div>

      <div class="list card">
        <label class="item item-input item-select">
          <div class="input-label">
            选择时间
          </div>
          <select ng-model="mymissions.yytime">
            <option selected>8</option>
            <option>9</option>
            <option>10</option>
            <option>11</option>
            <option>12</option>
            <option>13</option>
            <option>14</option>
            <option>15</option>
            <option>16</option>
            <option>17</option>
            <option>18</option>
          </select>
        </label>
      </div>
      <button class="button button-block" ng-click="sureBookdate(mymissions)">确认修改送货日期</button>
    </div>
    <div ng-if="(tasks.length == 0)" class="card">
      <div class="item item-text-wrap">
        啥都没有~~
      </div>
    </div>
    <div style="text-align: center" ng-if="(loadmore.more === true)">
      <a style="color: green;text-align: center" ng-click="getMore()" >加载更多</a>
    </div>
    <div style="text-align: center" ng-if="(loadmore.more === false)">
      <a style="color: green;text-align: center" >~没有了~</a>
    </div>
  </ion-content>
</ion-view>
